<?php

namespace app\index\validate;

use common\validate\BaseValidate;

class PlanVlidate extends BaseValidate
{

    protected $rule = [
        'plan_str|目标' => 'isNotEmpty|require',
        'plan_time|完成时间' => 'isNotEmpty|require|geToday',
        'cycle|循环周期' => 'between:0,2',
    ];
    protected $message = [
        'plan_str' => '目标必填',
        'plan_time' => '计划完成时间必填',
        'cycle' => '周期不合法',
    ];

    public function __construct($rule = [], $msg = [])
    {
        if (!empty($msg))
        {
            $this->message = $msg;
        }
        if (!empty($rule))
        {
            $this->rule = $rule;
        }
    }

}
